home *** CD-ROM | disk | FTP | other *** search
/ Plug-In Power Pack for Netscape Communicator / Plug-In Power Pack for Netscape Communicator.iso / plugins / dataviews / include / dvtypes.h < prev    next >
C/C++ Source or Header  |  1997-05-08  |  28KB  |  674 lines

  1. /* file -- dvtypes.h
  2. |===================================================================
  3. |
  4. |                          copyright (c) 1982
  5. |                    Intelligent Software Systems, Inc.
  6. |
  7. |    dvtypes.h
  8. |
  9. |    Alan C Morse      3 Sept 82
  10. |
  11. |    Alan C Morse    9 sept 82    Change color specifications
  12. |    Alan C Morse    28 Oct 8    Change slot count, add
  13. |                    data buffering (3rd dim of
  14. |                    data array), change
  15. |                    df pointer to df table pointer.
  16. |    Alan C Morse    15 Nov 82    Change to reflect removal
  17. |                    of instantiations.
  18. |    alan c morse    16 july 83    add foreground context color.
  19. |    alan c morse    19 april 84    add fval_mult_range.
  20. |       Marianne Smith  22 Jan 1991     Moved the definitions of values
  21. |                                       for flags in DF_DESC structure to
  22. |                                       dvstd.h
  23. |       mike krasnik    10 apr 91       changed VAR_DESC.range to double
  24. |       mike krasnik    12 apr 91       changed VAR_DESC.varsize to int
  25. |
  26. |===================================================================
  27. |
  28. |    include-file description/function:
  29. |    Contains typedefs of data structures that are useful to
  30. |    DataViews.  For instance, it contains the definition of the
  31. |    data group and variable descriptor data structures.
  32. |
  33. |===================================================================
  34. */
  35. #ifndef DVTYPES_H
  36. #define    DVTYPES_H
  37.  
  38. /*
  39. This describes the structure of the DataViews meta-display.  It is
  40. implemented as a linked list with forward and backward pointers.
  41. This allows us to use the C alloc() and free() functions to add
  42. space to the meta-display as necessary.
  43.  
  44. RULES / CONVENTIONS:
  45.  
  46. 1) Argument blocks that are pointed to by a data group have the
  47. following structure:  a longword count, giving the size in bytes
  48. of the argument block, followed by the argument block.  The pointer
  49. to this structure in the data group points to the beginning of the
  50. argument block, skipping the longword that contains the count.
  51. DataViews routine that free the space containing the copy of the
  52. argument block must also remember to deallocate the longword.
  53.  
  54. 2) To isolate display formatters from changes to datagroups once the
  55. the display formatter has been invoked, we have the following rule:
  56. Display formatters can only assume that the data group has current,
  57. valid data on its initial call; it must make copies of all data that
  58. it will need for future (update) calls.
  59. */
  60.  
  61. /*
  62.   ANYPTR typedef.
  63.   Typdef for use when a variable can be a pointer to
  64.   one of several scalar types.
  65. */
  66. typedef union anydataptr
  67.   {
  68.   char *charptr;
  69.   char *cp;
  70.   UBYTE *ucp;
  71.   short *shortptr;
  72.   short *sp;
  73.   unsigned short *usp;
  74.   int *intptr;
  75.   LONG *longptr;
  76.   LONG *lp;
  77.   ULONG *ulp;
  78.   float *floatptr;
  79.   float *fp;
  80.   double *dblptr;
  81.   double *dp;
  82.   union anydataptr *ap;
  83.   } ANYPTR;
  84.  
  85.  
  86. /*
  87.   ARRAY_WITH_COUNT typedef.
  88.   Typedef that standardizes the access to an array that is preceded
  89.   by a count, which tells the number of elements in the array.  This
  90.   structure allows you to get the size of the array and to get the
  91.   base address of the array.  If p is declared ARRAY_WITH_COUNT *p,
  92.   then the size of the array is p->elem_count and the base address
  93.   of the array is &p->first_elment.
  94. */
  95.     typedef struct ARRAY_WITH_COUNT
  96.       {
  97.       int elem_count;    /* must be int at least for GRs_color_table() */
  98.       LONG first_element;
  99.       } ARRAY_WITH_COUNT;
  100.  
  101. /*
  102.   ATTR typedef.
  103.   Typedef of structure that describes the graphical attributes
  104.   associated with a variable.  This is used in the VAR_DESC
  105.   data structure.
  106. */
  107.     typedef struct ATTR
  108.       {
  109.       UBYTE line_width; /* default = 1 */
  110.       UBYTE line_type; /* default = 0 = "solid" */
  111.       UBYTE area_fill; /* area fill pattern, tied to line type; 
  112.         | default = 0 = "solid" */
  113.       UBYTE symbol; /* Symbol associated with the variable.
  114.     | This is a letter specifying a shape as follows:
  115.     | '.' = Point; 'R' = Rectangle; etc. */
  116.       short colcount; /* Number of colors to be associated with 
  117.         | with the variable.  If this count is zero, it means that the
  118.         | next longword contains a color specification for the
  119.         | variable.  If the count is non-zero, it means that the next
  120.         | longword contains a pointer to a color threshold table. */
  121.       union
  122.         {
  123.         COLOR_THRESHOLD *colthreshp; /* Pointer to a table of thresholds
  124.           | and color specifications of type COLOR_THRESHOLD. */
  125.         COLOR_SPEC varcolor; /* color associated with variable 
  126.           | The default color is color index i, where i is the index
  127.           | of the variable in the variable index list. */
  128.         } colorinfo;
  129.       } ATTR; /* Attributes to be associated with the variable */
  130.  
  131. /*
  132.   DF_DESC typedef.
  133.   Typdef for a structure linking the data group to a display formatter.
  134. */
  135.     typedef struct DF_DESC
  136.       {
  137.       ENTRY_PT *(*df_jumptable) V_P_((ENTRY_PT*)); /* Pointer to a function that
  138.     | returns the table of entry points for the graph */
  139.  
  140.       ENTRY_PT *df_table; /* Pointer to a fixed size array of
  141.         | pointers to entry points in a display formatter.  The indices
  142.         | indicate what type of call to the display formatter
  143.         | this is.  Some of the possible types of calls are: Initial
  144.         | call, display update call, error call, cleanup heap call.  The
  145.         | indices that correspond to each type of call is fixed system-
  146.         | wide, and is defined using parameters. This table is assumed
  147.         | to be static; that is, it isn't in the heap.  So when a copy
  148.         | is made of DF_DESC data structure, this pointer is simply 
  149.         | copied.  We should not allocate space for and make a copy
  150.         | of the jumptable. (This means that this space should not
  151.         | be freed when the DF_DESC is deleted.) */
  152.  
  153.       ENTRY_PT disp_formatter;  /* Pointer to the current
  154.         | display formatter (DF) entry point.
  155.         | This routine expects a single argument, a pointer to a data
  156.         | structure of type DATAGROUP.  This is one of the entry points
  157.         | from the above array.  Initially, it is the first entry in the
  158.         | above array.  Then the display formatter sets it to something
  159.         | else, depending on the results of its first attempt at drawing
  160.         | the data described by the dg. */
  161.  
  162.       ADDRESS dfargs; /* Pointer to a count and an array of 
  163.     | NAME_VALUE_PAIRs that are used to pass arguments to
  164.     | display formatters.  The interpretation of these pairs
  165.     | is highly display formatter-dependent.  The count is
  166.     | a short giving the number of pairs immediately following. */
  167.  
  168.       ADDRESS ptemp_area ; /*  Pointer to a temporary storage area 
  169.         | for use by the display formatter.
  170.         | The data that this points to must be freed from the heap
  171.         | by an entry point in the display formatter module, which
  172.         | entry point gets called when the display formatter gets
  173.         | disconnected from the data group. */
  174.  
  175.       ADDRESS data_buff; /* Pointer to data buffer used by
  176.     | display formatter. */
  177.  
  178.       ULONG flags; /* Flags that reflect the current status of
  179.     | the datagroup. */
  180.  
  181.       } DF_DESC;
  182.  
  183.  
  184. /*
  185.   LINKS typedef.
  186.   Typdef describing the DataViews standard structure for implementing
  187.   doubly linked list.
  188. */
  189.     typedef struct linkstruct
  190.       {
  191.       struct linkstruct *next;/* Ptr to next entry in linked list. */
  192.       struct linkstruct *prev;/* Ptr to previous entry in linked list*/
  193.       short checkf;  /* Flag containing a constant that tells the type 
  194.         | of linked list entry.  For instance, this number might be
  195.         | a constant that says, "I am a datagroup descriptor."
  196.         | This constant should be set to the appropriate value when the
  197.         | linked list entry is created (allocated). */
  198.       } LINKS;
  199.  
  200. /*
  201.   TIC_DATA typedef.
  202.   Typedef of structure used by axis tic makers.  This structure
  203.   contains intermediate as well as final results from tic
  204.   position calculations.  This structure allows the user to 
  205.   initialize certain parameters to influence where tic marks
  206.   get placed and how they get labelled.
  207.   Those data that can be preset to constrain the tic calculations are:
  208.   1) Data range (must be set by caller).
  209.   2) Minimum minor and major tic mark gaps, in either pixel space or
  210.      value space (or both).  One of these four must be specified
  211.      (greater than zero).
  212.   3) base_exponent. If this is preset, then it gives the minimum
  213.      value that the base_exponent can have.
  214.   4) ticratio can be set, constraining the number of minor tic
  215.      marks per major tic mark.  The only acceptable values are
  216.      1, 2, 5 or 10.
  217.   5) The type of the first tic mark. Must be in range [0,ticratio).
  218.      This allows forcing the first tic mark to be a major tic mark
  219.      by setting first_tic_type to zero.
  220.   Flags are used to tell which of these has been preset when it
  221.   can't be obvious from the data value.  Non-zero values indicate
  222.   preset data for items 2 and 4.  3 and 5 use flags.
  223. */
  224.   typedef struct TIC_DATA
  225.     {
  226.     struct
  227.       {
  228.       unsigned fbase_exp: 1; /* Base exponent has been set */
  229.       unsigned ffirst_tic_type: 1; /* First tic type has been set */
  230.       unsigned is_filled_in: 1; /* All the data has been filled in the
  231.         | TIC_DATA data structure by call to VXtdsetup. */
  232.       unsigned minimum_ticks: 1; /* The axis has the minimum number of
  233.     | tick marks; either a single tick mark (if pgap = 0) or
  234.     | two tick marks, one at each end. */
  235.       unsigned IsLogScale;
  236.       } tdflags; /* Says which data in the
  237.           | in the data structure has been initialized.
  238.           | Data that has not been initialized gets default values,
  239.           | or values that are extracted from the data group. */
  240.  
  241.     double vmin, vmax; /* Range of data values. */
  242.  
  243.     double axmin, axmax; /* Range of axis values.
  244.       | For linear data, these are the same as vmin, and vmax.
  245.       | For log data, these are log(vmin) and log(vmax). */
  246.  
  247.     short axis_length; /* Length of axis in pixel space. */
  248.  
  249.     struct            /* Minimum distances in pixel space between ... */
  250.       {
  251.       short sminor;  /* minor and ...*/
  252.       short smajor;  /* major tic marks. */
  253.       } pgap_min;
  254.  
  255.     struct           /* Minimum differences in data values between ...*/
  256.       {
  257.       double fminor;  /* adjacent minor and ... */
  258.       double fmajor;  /* major tic marks. */
  259.       } vgap_min;
  260.  
  261.     short base_exponent; /* Power of ten that is the basis for the
  262.       | differences in value between adjacent tic marks.  Actual
  263.       | differences are factors of 1, 2, 5, or 10 times
  264.       | 10 raised to this value. */
  265.  
  266.     struct            /* Ratio of increments in data value of ... */
  267.       {
  268.       char tminor;    /* minor and ... */
  269.       char tmajor;    /* major tic marks values to the basis scale. */
  270.       } ticbase_ratio;
  271.  
  272.     char ticratio; /* Ratio of major to minor
  273.       | tic data value increments. */
  274.  
  275.     char first_tic_type; /* Type of first tic mark: 0 means "major"; 
  276.       |   0 < i < ticratio means the i-th minor tic mark. */
  277.  
  278.     double vgap; /* Data value increment that corresponds to one minor
  279.       | tic mark gap. */
  280.  
  281.     double vinitial; /* Data value that corresponds to the first tic
  282.       | mark (minor or major). */
  283.  
  284.     double pgap; /* Pixel distance between adjacent minor tic marks. */
  285.  
  286.     double poffset; /* Pixel distance to first tic mark
  287.       | (minor or major). */
  288.  
  289.     } TIC_DATA;
  290.  
  291. typedef void (*DV_TICLABELFUNPTR) V_P_((ADDRESS argpcopy, double *value,
  292.                     ADDRESS output, TIC_DATA *tdp));
  293.  
  294. /*
  295.   TICLABELLER_DESC typedef.
  296.   Typedef of the structure that describes how the axis tic marks are
  297.   to be labelled.  The TIC_DATA data structure describes how the tic
  298.   marks are to be placed and what values correspond to each tic mark.
  299.   These values can be mapped via a user-supplied function to
  300.   character strings for labelling the tic marks; otherwise the value
  301.   is used as a label.
  302. */
  303.     typedef struct TICLABELLER_DESC
  304.       {
  305.       TIC_DATA *ptic_data; /* Pointer to a structure that describes
  306.         | where the tic marks are to go and what data values are
  307.         | associated with them.  These associated values are used to
  308.         | determine how they are to be labelled. */
  309.  
  310.       DV_TICLABELFUNPTR pval_to_string; /* Ptr to a function that takes as
  311.         | arguments 1) a pointer to an argument list (specified below);
  312.         | 2) a pointer to a double precision value; 3) a pointer
  313.         | to a character array to receive the resulting string;
  314.         | and 4) a pointer to the relevant TIC_DATA data structure
  315.     | (if any).
  316.         | The routine must provide a way of finding out the longest
  317.         | possible string that can be returned.  The arguments to
  318.         | find this out are: 1) the same pointer as above, 2) a NULL
  319.         | pointer, 3) a pointer to a longword to receive the
  320.         | length of the longest string that the function will generate,
  321.         | and 4) a pointer to the appropriate TIC_DATA data structure.
  322.         | This latter type of call will also initialize appropriate
  323.         | arguments in the pvtos_args argument list. */
  324.  
  325.       ADDRESS pvtos_args; /* Pointer to an argument list for the above
  326.         | function.  This follows the DataViews conventions for
  327.         | handling pointers to argument lists, namely, that the size
  328.         | in bytes of the argument list precedes the argument list,
  329.         | and the argument list cannot point to allocated structures
  330.         | that nobody is going to know how to deallocate. */
  331.  
  332.       } TICLABELLER_DESC;
  333.  
  334.  
  335. /*
  336.   GRID_ATTR typdef.
  337.   Axis Grid attributes:
  338.     1) color,
  339.     2) line type,
  340.     3) and line width.
  341. */
  342. typedef struct
  343.   {
  344.   COLOR_SPEC Color;
  345.   char LineType;
  346.   char LineWidth;
  347.   } GRID_ATTR;
  348.  
  349. /*
  350.   AXIS_DESC typedef.
  351.   This contains information about an axis:
  352.     1) Its label.
  353.     2) How the tick marks are to drawn and labelled.
  354.     3) The grid (if any) attributes.
  355. */
  356. typedef struct
  357.   {
  358.   char *label; /* Ptr to label for the variable's value axis 
  359.     | If this pointer is NULL then there is no value axis label. */
  360.  
  361.   TICLABELLER_DESC *ticks; /* Ptr to structure that describes 
  362.     | the axis tic mark labelling.  If this pointer is NULL then
  363.     | it means that the default axis tic mark labelling should be
  364.     | used. */
  365.  
  366.   GRID_ATTR GridAttr;/* Axis Grid attributes */
  367.   } AXIS_DESC;
  368.  
  369. /*
  370.   DG_AXES typedef.
  371.   Typedef for the stuff that describes how the datagroup's axes are to
  372.   be labelled.  This only includes those axes that apply to the
  373.   data group as a whole, namely, the 2 dimension axes and the time axis.
  374. */
  375. typedef struct DG_AXES
  376.   {
  377.   AXIS_DESC *TimeAxis; /* Info describing time axis */
  378.  
  379.   /* Time axis tick mark labelling info */
  380.   float TimeStart, TimeIncrement; /* Describes values associated with
  381.     | time slot positions.  Normally, the system labels the time
  382.     | slots consecutively (i.e., increment is 1) starting with 1.
  383.     | If the Increment is zero, then it means to use the default. */
  384.  
  385.   AXIS_DESC *D1Axis; /* The first space dimension axis */
  386.  
  387.   AXIS_DESC *D2Axis; /* The second space dimension axis */
  388.   } DG_AXES;
  389.  
  390. /* V_DGP_CONSECUTIVE_TIME_AXIS */
  391. /* MACRO to test if time axis labels slots with consecutive integers. */
  392. /* This is a superset of the default case and means that TimeStart is */
  393. /* an integer and TimeIncrement is 1.0.                               */
  394. /* This yields a boolean (YES/NO) result.                             */
  395. /* This requires that <math.h> be included.                           */
  396. #define V_DGP_CONSECUTIVE_TIME_AXIS( dgp ) \
  397.   ( ((DATA_GROUP*)dgp)->axinfo->TimeIncrement == 1.0 && \
  398.     ((DATA_GROUP*)dgp)->axinfo->TimeStart == \
  399.       S_FLOOR( ((DATA_GROUP*)dgp)->axinfo->TimeStart ) )
  400.  
  401. /* V_DGDF_NO_MINOR_TIME_TICS */
  402. /* Macro to test if we are to put minor ticks on the time axis.     */
  403. /* For graphs with time slots, it may not make sense to put these ticks */
  404. /* in. This is true if the ticks are integers that are sequential       */
  405. #define V_DGDF_NO_MINOR_TIME_TICS V_DGP_CONSECUTIVE_TIME_AXIS
  406. /*
  407.   VAR_DESC typedef.
  408.   Typdef for the descriptor for each variable in the data group.
  409.   There is a linked list of these descriptors for each data group.
  410. */
  411.  
  412. #ifdef VAR_DESC 
  413. #        undef VAR_DESC
  414. #endif
  415.  
  416. typedef struct vdstruct
  417.   {
  418.   LINKS link;
  419.  
  420.   short refcount; /* Number of references to this structure */
  421.  
  422.   ANYTYPE *pvar; /* Ptr to base address of variable, which may not 
  423.     | actually be LONG integer. */
  424.  
  425.   struct
  426.     {
  427.     int d1; /* Size of variable in dimension 1.      default: 1 */
  428.     int d2; /* Size of variable in dimension 2.      default: 1 */
  429.     int d3; /* Size of variable in dimension 3.      default: 1 */
  430.     } varsize; /*  All the variables in the data group 
  431.       | ought    to be the same size.  Different size variables
  432.       | should be simulated using access functions.
  433.       | Conceptually, all variables are vectors of time slices of
  434.       | of 2D data.  d3 gives the number of time slices, d2 gives
  435.       | the number of rows, and d1 gives the number of columns.
  436.       | In C, this means that d1 index changes the fastest and is
  437.       | the rightmost index.  Thus, a single
  438.       | scalar has (d3,d2,d1) = (1,1,1);
  439.       | a buffered scalar has (n,1,1);
  440.       | a single time slice of a vector has (1,n,1) or (1,1,n); etc.
  441.       | matrices, and vectors are n by 1 matrices. */
  442.  
  443.   ADDRESS pvaraccess; /* Ptr to access function (if any) for the 
  444.     | variable.  This function is supposed to return an integer
  445.     | in the range [0,32767] if the value is to be normalized, or
  446.     | a pointer to a float if the value is not to be normalized.
  447.     | (The number is usually normalized and converted to integer
  448.     | to improve speed.) If for some reason the variable has an
  449.     | undefined value, this routine returns a -1.
  450.     |
  451.     | This function always takes as arguments
  452.     | a ptr to an access block (structure of arguments describing
  453.     | the variable, see pva_args described next), and three array
  454.     | indices, which may be ignored by the access function and which
  455.     | will be zero if the variable has associated dimension of one.
  456.     | If the first array index to the function is -1, then the 
  457.     | function should return the next value (normalized) in the
  458.     | variable's array.
  459.     | If the first array index is -2, the access function should
  460.     | return a pointer to a float containing the actual value
  461.     | that was last accessed.
  462.     | The default for this function is the normal sequential access
  463.     | function for the corresponding data type and dimension of this
  464.     | variable. */
  465.  
  466.   ADDRESS pva_args; /* Pointer to structure that the variable access 
  467.     | function uses to facilitate access to the variable.  Since the
  468.     | structure varies according to the access function, we declare
  469.     | simply as a generic pointer (ADDRESS).  The space pointed to
  470.     | must be freed (deallocated) before this variable descriptor can
  471.     | be deleted. */
  472.  
  473.   UBYTE vartype;  /* flag indicating type of the variable.  The 
  474.     | possible values are:
  475.     |    0 = "unknown"
  476.     |    1 = "CHAR integer"
  477.     |    2 = "unsigned CHAR integer"
  478.     |    3 = "SHORT integer"
  479.     |    4 = "USHORT integer"
  480.     |    5 = "LONG integer"
  481.     |    6 = "ULONG integer"
  482.     |    7 = "float"
  483.     |    8 = "double-precision float"
  484.     |    9 = "text string" (NULL-terminated) */
  485.  
  486.   UBYTE varaccess; /* flag indicating type of access to variable.
  487.     |    0 =  direct access - base address points to actual data
  488.     |    1 =  indirect access - base points to pointer to
  489.     |         actual data.
  490.     |    3 =  indirect access and bound to a DataViews datasource,
  491.     |    which needs to be notified when deleting.
  492.     |    NOTE this field also encodes whether the variable is
  493.     |    a log variable.  The 5th bit from the right is used
  494.     |    to encode this (i.e., 0x10 masks the bit
  495.     |    The default for this variable is "direct access"
  496.     |    "not a log," that is, varaccess is zero */
  497.  
  498.   UBYTE vd_is_in_dg; /* Flag saying whether the vdp is in a linked list
  499.     | that has a DATAGROUP at its head. This is YES if it is part
  500.     | of DATAGROUP, NO otherwise. */
  501.  
  502.   struct
  503.     {
  504.     double lo;
  505.     double hi;
  506.     } range; /* Range of data values to be encoded. */
  507.  
  508.   ATTR attr; /* Graphical attributes associated with the variable.*/
  509.  
  510.   char *pvarname; /* Ptr to text string that names the variable. */
  511.  
  512.   AXIS_DESC *axis; /* Information describing how the axis is to
  513.     | to be labelled, marked with ticks, and gridded. 
  514.     | If this pointer is NULL and this variable descriptor
  515.     | is the first in the list of variable descriptors associated
  516.     | with a data group then it means that there is no axis information.
  517.     | If the pointer is NULL and this is not the first variable
  518.     | descriptor then it means: "use the value axis information
  519.     | from the first variable descriptor in the list." */
  520.   } VAR_DESC;
  521.  
  522. /*
  523.   CONTEXT_FLAGS typedef.
  524.   Context control flags for a graph (DATAGROUP).
  525. */
  526. typedef struct
  527.   {
  528.   unsigned fpre_erase: 1; /* If set, it means the display
  529.     | formatter should clear the viewport before initially
  530.     | drawing into it.  If this is not set, the display
  531.     | formatter will overlay whatever is already on the screen
  532.     | in the display viewport.  This doesn't guarantee that
  533.     | repeated calls to the display formatter will result in a
  534.     | clean overlay.  The display formatter will have to do some
  535.     | erasing in updating the display. Default: YES */
  536.   unsigned fcontext: 1; /* Put up display context. If NO, all
  537.     | that is to appear is the display of the encoded data.
  538.     | This overrides the settings for all the flags below.
  539.     | They are treated as if the were set to NO, if this is set
  540.     | to NO. Default: YES */
  541.   unsigned flegend: 1; /* Put up the legend. Default: YES */
  542.   unsigned fvpbox: 1; /* Draw a box around the datagroup viewport 
  543.     | Default: YES */
  544. /*
  545.   Flags that control the quality of the time axis labelling.
  546. */
  547.   unsigned ftim_tics: 1; /* Draw tic marks?  Default: NO */
  548.   unsigned ftim_mintics: 1; /* If we're drawing tic marks, do
  549.     | we draw the minimum number of tic marks, namely, one at
  550.     | each end of the axis, giving the minimum and maximum values
  551.     | for the data? Default: NO */
  552.   unsigned ftim_label_tics: 1; /* If we have tic marks, do we
  553.     | label them?  Default: NO */
  554. /*
  555.   Flags that control the quality of the d1 axis labelling.
  556. */
  557.   unsigned fd1_tics: 1; /* Draw tic marks?  Default: NO */
  558.   unsigned fd1_mintics: 1; /* If we're drawing tic marks, do
  559.     | we draw the minimum number of tic marks, namely, one at
  560.     | each end of the axis, giving the minimum and maximum values
  561.     | for the data? Default: NO */
  562.   unsigned fd1_label_tics: 1; /* If we have tic marks, do we label
  563.     | them?  Default: NO */
  564. /*
  565.   Flags that control the quality of the d2 axis labelling.
  566. */
  567.   unsigned fd2_tics: 1; /* Draw tic marks?  Default: NO */
  568.   unsigned fd2_mintics: 1; /* If we're drawing tic marks, do
  569.     | we draw the minimum number of tic marks, namely, one at
  570.     | each end of the axis, giving the minimum and maximum values
  571.     | for the data? Default: NO */
  572.   unsigned fd2_label_tics: 1; /* If we have tic marks, do we label
  573.     | them?  Default: NO */
  574. /*
  575.   Flags that control the quality of the value axis labelling.
  576. */
  577.   unsigned fval_tics: 1; /* Draw tic marks?  Default: NO */
  578.   unsigned fval_mintics: 1; /* If we're drawing tic marks, do
  579.     | we draw the minimum number of tic marks, namely, one at
  580.     | each end of the axis, giving the minimum and maximum values
  581.     | for the data? Default: NO */
  582.   unsigned fval_label_tics: 1; /* If we have tic marks, do we
  583.     | label them?  Default: NO */
  584.  
  585.   unsigned fval_mult_range: 1; /* Do we allow multiple value
  586.     | ranges?  If yes, then each variable will be displayed
  587.     | by scaling to its own range.  If no, a common range
  588.     | for all the variables will be determined, which range
  589.     | encompasses all the ranges, and this range will be
  590.     | used by the display formatter for all variables.
  591.     | The default for this flag is YES. */
  592. /*
  593.   Flags that control grids in graphs.
  594. */
  595.   unsigned ftime_grid: 1; /* Should we display a grid for the
  596.     | time axis. */
  597.   unsigned fval_grid: 1; /* Should we display a grid for the
  598.     | value axis. */
  599.   } CONTEXT_FLAGS;
  600.  
  601. /*
  602.   DATAGROUP typedef.
  603.   Typdef of the top-level structure in the data structure that describes
  604.   a DataViews data group.  The meta-display comprises a linked list of
  605.   of the structures of this type.
  606. */
  607.  
  608. #ifndef DATAGROUP 
  609. #define DATAGROUP ADDRESS
  610. #endif
  611.  
  612.     typedef struct dgstructure
  613.       {
  614.       LINKS link;
  615.  
  616.       char *dgtitle; /* Pointer to title for labelling the display 
  617.         | of the data group's data. */
  618.  
  619.       DG_AXES *axinfo;  /* Pointer to info describing the axis labels */
  620.  
  621.       LONG flags; /* Control display of context of graph */
  622.  
  623.       short numvar;  /* Number of data variables in this data group. */
  624.  
  625.       VAR_DESC *pvardesc;  /* Ptr to the first descriptor in a 
  626.         | linked list of descriptors that describe each variable
  627.         | in the data group.  There are numvar of these structures. */
  628.  
  629.       FLOAT_POINT vpll, vpur; /* Lower left and upper right coordinates
  630.         | of the datagroup stored in Normalized Device Coordinates
  631.         | ( in the range from 0.0 to 1.0 ). */
  632.  
  633.       COLOR_SPEC backcolor; /* Background color, default is black
  634.     | ( zero color table index value )*/
  635.  
  636.       COLOR_SPEC forecolor; /* Foreground color, used for drawing
  637.     | the display context; the default is half intensity grey. */
  638.  
  639.       UBYTE devndx; /* Index of device on which to display
  640.     | the data. This index is into an array of device numbers
  641.     | maintained by DataViews.  Users insert the numbers into the
  642.     | array implicitly when they open the devices. */
  643.  
  644.       short slotcount; /* Number of time slices that are to fit into
  645.         | one data display.  For an animated display, this is one. 
  646.         | For a datagroup for which the 100 most recent values are
  647.         | to be displayed, this would be 100. */
  648.  
  649.       short buffernum;  /*  Number of data elements to be stored
  650.         |  in the graphs data buffer.  By default buffernum is
  651.         |  set to slotcount.  A constraint is that buffernum cannot
  652.         |  be less than slotcount - since enough data must be buffered
  653.         |  so that the graph can be redrawn. */ 
  654.  
  655.       short ScrollAmount; /* Number of time slices to scroll the
  656.     | display when it fills up and there is no more room
  657.     | for history data.  For graphs that can display history
  658.     | the following values make sense:
  659.     |    ScrollAmount = 0  means "wrap around"
  660.     |    ScrollAmount = 1  means "scroll left one slot"
  661.     |        (this is a strip chart)
  662.     |    ScrollAmount = n, where 1 <= n < slotcount means
  663.     |        scroll left n slots, leaving n slots empty.
  664.     |    ScrollAmount = slotcount  means "erase all slots"
  665.     */
  666.  
  667.       DF_DESC *pdfd; /* Pointer to a display formatter descriptor, 
  668.         | which will be NULL in cases where no display formatter
  669.         | has been linked to the datagroup. */
  670.  
  671.       } DATA_GROUP;
  672.  
  673. #endif /* DVTYPES_H*/
  674.